<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<ui:composition template="../template/layout.xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<ui:param name="pageHeaderTitle" value="Create client profile" />
	<ui:param name="pageTitle" value="Create client profile" />
	<ui:define name="content">
		<div id="inner_content">
			<h:form>
				<h:panelGrid columns="2"
					columnClasses="createClientGridColumn1, createClientGridColumn2"
					cellpadding="8" style="width: 550px">
					
					<h:panelGroup>
						<p:outputLabel value="First Name" for="firstName" />
						<br />
						<p:inputText id="firstName"
							value="#{createClientBean.client.firstName}" maxlength="30"/>
					</h:panelGroup>
					
					<h:panelGroup>
						<br />
						<p:message for="firstName" />
					</h:panelGroup>

					<h:panelGroup>
						<p:outputLabel value="Last Name" for="lastName" />
						<br />
						<p:inputText id="lastName"
							value="#{createClientBean.client.lastName}" maxlength="30" />
					</h:panelGroup>
					
					<h:panelGroup>
						<br />
						<p:message for="lastName" />
					</h:panelGroup>

					<h:panelGroup>
						<p:outputLabel value="Birth date" for="birthDate" />
						<br />
						<p:calendar value="#{createClientBean.client.birthDate}"
							id="birthDate" showOn="button" styleClass="pCalendar" pattern="MM/dd/yyyy" 
							converter="stringToCalendarConverterNoTime" mindate="01/01/1900" maxdate="c" 
							navigator="true" readonly="#{facesContext.renderResponse}" />
					</h:panelGroup>
					
					<h:panelGroup>
						<br />
						<p:message for="birthDate" />
					</h:panelGroup>

					<h:panelGroup>
						<p:outputLabel value="Telephone" for="phone" />
						<br />
						<p:inputMask id="phone" value="#{createClientBean.client.phone}"
							mask="(999) 999-9999" />
					</h:panelGroup>
					
					<h:panelGroup>
						<br />
						<p:message for="phone" />
					</h:panelGroup>

					<h:panelGroup>
						<p:outputLabel value="Discount category" for="selectCategory" />
						<br />
						<p:selectOneMenu id="selectCategory" panelStyle="width:150px"
							style="width:160px" converter="stringToDiscountCategoryConverter"
							value="#{createClientBean.client.cat}">
							<f:selectItems value="#{createClientBean.discountCategoryList}" />
						</p:selectOneMenu>
					</h:panelGroup>
					
					<h:panelGroup>					
					</h:panelGroup>

					<h:panelGroup>
						<p:outputLabel value="Information" for="information" />
						<br />
						<p:inputTextarea id="information" rows="20" cols="50"
							autoResize="false" styleClass="info_area"
							value="#{createClientBean.client.info}" maxlength="250"/>
					</h:panelGroup>
					
					<h:panelGroup>
						<br />
						<p:message for="information" />
					</h:panelGroup>

					<h:panelGroup>
						
						<p:commandButton value="Submit"
							action="#{createClientBean.createClient()}" style="margin-top: 8px"
							styleClass="pCommandButton" ajax="false" />
					</h:panelGroup>
				</h:panelGrid>
			</h:form>
		</div>
	</ui:define>
</ui:composition>
</html>